<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="portal" uri="/WEB-INF/portal.tld" %>
<%@ taglib prefix="uct" uri="/WEB-INF/uct.tld" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <%@ include file="/common/sale/include/common-base.jsp"%>		
  <script type="text/javascript" src="/js/jquery-md5-min.js"></script>
  <script src="${ctx}/js/uct/date.js"></script>
  <script src="${ctx}/js/tools-login.js"></script>
  <script src="${ctx}/js/tools-upload.js"></script>
  <script src="${ctx}/js/dict-client.js"></script>
  <title>交易商管理-${titleName}</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <script>
  var add_url = "${ctx}/res/uct/admin/saveUser";
  var del_url = "${ctx}/res/uct/admin/delUser";
  var view_url = "${ctx}/trans/info/userInfo";
  //var org_url = "${ctx}/uct/org/org!initOrg.action";
  var org_url = "${ctx}/trans/list/orgInit";
  var dept_url = "${ctx}/trans/list/deptInit";//?orgId=${item.orgId}
  var id;
  var userId;
  var userEname;
  //附件相关服务配置
  var myAttaServer = '<portal:config varKey="atta_server"/>';
  var myAttaDomain = '<portal:config varKey="atta_domain"/>';
  </script>
</head>
<body class="hold-transition ${sysColor} sidebar-mini">
<div class="wrapper">

  <!-- top start -->
  <%@include file="/common/sale/top.jsp" %>
  <!-- top end -->
  <!-- left start -->
  <%@include file="/common/sale/left.jsp" %>
  <!-- left end-->

  <div class="content-wrapper">
  <!--  
		<ol class="breadcrumb bgblue">
			<li>
				<span class="label label-danger font14" >机构与用户管理 / 用户管理</span>
			</li>
		</ol>
	-->	
    <!-- Main start -->

<section class="content">
      <div class="row">
        <div class="col-xs-12">
        
        <!-- 机构搜索 start -->
           <div class="box box-info">
             <!--搜索title  start --> 
	          <div class="box-header with-border">
                 <h3 class="box-title"><i class="fa fa-search"></i> 交易商搜索</h3>
                 <div class="box-tools pull-right" style="display: none;">
	                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
	                </button>
	                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
                 </div>
              </div>
            <!--搜索title  end --> 
            
            <div class="box-body">
			  <form id="searchFrom" class="form-horizontal">
				<!--  <input type="hidden" name="userStatus" value="1"/>
				-->
				<input type="hidden" name="doCode" value="dymicSql"/>
				<input type="hidden" name="modelTypes" value="s_uctUser"/>
				<input type="hidden" name="uctUser.wi_auditStatus" value="90,91"/>
				<input type="hidden" name="orderBy"  value="uctUser.create_time desc" />
				<c:if test="${loginUser.sysFlag !='1'}">
				   <input type="hidden" name="orgId" id='searchForm_orgId' value="${loginUser.orgId}"/>
				</c:if>
				<div class="col-sm-11">
				<div class="form-group">
					<div class="col-sm-2 text_r"><label class="control-label">所属机构：</label></div>
					<div class="col-sm-2">
						 <select class="form-control" name="uctUser.w_orgId" id="searchForm_org" onchange="setDeptIdValue('searchForm_deptId',this)"></select>
					</div>
					<div class="col-sm-2 text_r"><label class="control-label">登录账号：</label></div>
					<div class="col-sm-2">
						 <input class="form-control clean" name="uctUser.wl_userEname" id="userEname" value="" type="text">
					</div>
					<div class="col-sm-2 text_r"><label class="control-label">用户名称：</label></div>
					<div class="col-sm-2">
						 <input class="form-control clean" name="uctUser.wl_userCname" id="userCname" value="" type="text">
					</div>
				</div>
				<center>
				   <div class="box-footer clearfix">
				       <button type="button" class="btn btn-success" onclick="getTableData();"><i class="fa fa-search"></i> 查询</button>&nbsp;
				       <button type="button" class="btn btn-warning" onclick="cleanData('searchFrom');">重置 </button>
				   </div>
				</center>
			  </div>
			  </form>
            </div>
	     </div>
         <!-- 机构搜索 end -->
        
      <div class="box box-success">
            <div class="box-header with-border">
                 <h3 class="box-title"><i class="fa fa-user"></i>  交易商管理　　　
						<!-- <button class="btn btn-success" type="button" onclick="toAdd();">增加</button> -->
						<button class="btn btn-warning" type="button" onclick="toView(userId);">查看</button>
				        <button class="btn btn-info" type="button" onclick="toEdit(userId);">修改</button>
				        <button class="btn btn-danger" type="button" onclick="toCancelUser(userId);">销户</button>
				        <button class="btn btn-warning" type="button" onclick="refresh();">刷新</button>
                 </h3>
                 <div class="box-tools pull-right" style="display: none;">
	                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
	                </button>
	                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
                 </div>
              </div>
            <!-- /.box-header -->
            <div class="box-body">
              <table id="example" class="table table-bordered table-hover" >
                <thead class="bg-success">
                <tr>
                  <th>序号</th>
                  <th>登录账号</th>
                  <th>用户名称</th>
                  <th>所属机构</th>
                  <th>所属部门</th>
                  <!-- <th>用户类型</th> -->
                  <th>性别</th>
                  <th>手机</th>
                  <th>注册时间</th>
                  <th>状态</th>
                  <!-- <th>操作</th> -->
                </tr>
                </thead><tbody id="myList"></tbody>
              </table>
         	    <center><ul id="pageList"></ul></center>
            </div>
          </div>
        </div>
      </div>
    </section>
    <!-- Main end -->
  </div>
  
<div class="modal fade" id="my_modal_edit" tabindex="-1" data-backdrop="static" data-keyboard="false" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width: 900px;">
				<div class="modal-content" id="user-editManager"></div>
				<!-- /.modal-content -->
			</div>		
</div> 
 

<div class="modal fade " id="my_modal_view" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width: 900px;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title">
					<font color="red">查看</font>&nbsp;
				</h4>
			</div>
			<div class="modal-body" >
				<form id="auditFrom" name="auditFrom" class="container" style="width:100%">
					<input type="hidden" id="userId" data-name="userId" class="clean" value=""/>
					<div class="row" style="margin-left: 20px;">
						<div class="form-group col-sm-6">
							<label class="control-label col-sm-4">登录账号：</label>
							<div class="col-sm-8">
								<span data-name="userEname"></span>
							</div>
						</div>
						<div class="form-group col-sm-6">
							<label class="control-label col-sm-4">用户名称：</label>
							<div class="col-sm-8">
								<span data-name="userCname"></span>
							</div>
						</div>
					</div>
					 
					<div class="row" style="margin-left: 20px;">
						<div class="form-group col-sm-6">
							<label class="control-label col-sm-4">公司名称：</label>
							<div class="col-sm-8">
								<span data-name="company"></span>
							</div>
						</div>
						
						<div class="form-group col-sm-6">
							<label class="control-label col-sm-4">手机：</label>
							<div class="col-sm-8">
								<span data-name="mobile"></span>
							</div>
						</div>
					</div>
					
					<!-- ORG INFORMATION START!!! -->
				  	<div id="_org_view">
				  		<div class="row" style="margin-left: 20px;">
							<div class="form-group col-sm-6">
								<label class="control-label col-sm-4">注册地：</label>
								<div class="col-sm-8">
									<span data-name="address"></span>
								</div>
							</div>
							<div class="form-group col-sm-6 ">
								<label class="control-label col-sm-4">注册资本：</label>
								<div class="col-sm-8">
									<span data-name="regCapital"></span>（元）
								</div>
							</div>
						</div>
						<div class="row"  style="margin-left: 20px;">
							<div class="form-group col-sm-6">
								<label class="control-label col-sm-4">成立时间：</label>
								<div class="col-sm-8">
									<span data-name="regTime"></span>
								</div>
							</div>
							<div class="form-group col-sm-6 ">
								<label class="control-label col-sm-4">法人代表：</label>
								<div class="col-sm-8">
									<span data-name="legalPerson"></span>
								</div>
							</div>
						</div>
						<div class="row"  style="margin-left: 20px;">
							<div class="form-group col-sm-6">
								<label class="control-label col-sm-4">所属行业：</label>
								<div class="col-sm-8">
									<span data-name="strFiftyThree" data-dict="Industrycode"></span>
								</div>
							</div>
							<div class="form-group col-sm-6 ">
								<label class="control-label col-sm-4">企业类型：</label>
								<div class="col-sm-8">
									<span data-name="enterpriseType" data-dict="buyerjjlx" ></span>
								</div>
							</div>
						</div>
						<div class="row"  style="margin-left: 20px;">
							<div class="form-group col-sm-6">
								<label class="control-label col-sm-4">组织机构代码：</label>
								<div class="col-sm-8">
									<span data-name="orgCode"></span>
								</div>
							</div>
						</div>
					  	<div class="row"  style="margin-left: 20px;">
						  	<div class="form-group col-sm-6">
								<label class="control-label col-sm-4">经营范围：</label>
								<div class="col-sm-8">
									<span data-name="strFiftyOne"></span>
								</div>
							</div>
					  	</div>
					  	<div class="row" style="margin-left: 20px;">
						  	<div class="form-group col-sm-12">
								<label class="control-label col-sm-8">附件1：交易参与人（企业）资格申请表：</label>
								<div class="col-sm-4">
									<a target="_blank" data-name="strHundredFour">下载</a>
								</div>
							</div>
					  	</div>
					  	<div class="row" style="margin-left: 20px;">
						  	<div class="form-group col-sm-12">
								<label class="control-label col-sm-8">附件2：企业组织机构（或三证合一）扫描件：</label>
								<div class="col-sm-4">
									<a target="_blank" data-name="strHundredFive">查看</a>
								</div>
							</div>
					  	</div>
					  	<div class="row" style="margin-left: 20px;">
						  	<div class="form-group col-sm-12">
								<label class="control-label col-sm-8">附件3：交易代表推荐函：</label>
								<div class="col-sm-4">
									<a target="_blank" data-name="strHundredSix">下载</a>
								</div>
							</div>
					  	</div>
					  	<div class="row" style="margin-left: 20px;">
						  	<div class="form-group col-sm-12">
								<label class="control-label col-sm-8">附件4：交易代表身份证复印件正面照：</label>
								<div class="col-sm-4">
									<a target="_blank" data-name="strHundredTwo">查看</a>
								</div>
							</div>
					  	</div>
					  	<div class="row" style="margin-left: 20px;">
						  	<div class="form-group col-sm-12">
								<label class="control-label col-sm-8">附件5：交易代表身份证复印件反面照：</label>
								<div class="col-sm-4">
									<a target="_blank" data-name="strHundredThree">查看</a>
								</div>
							</div>
					  	</div>
					  	<div class="row" style="margin-left: 20px;">
						  	<div class="form-group col-sm-12">
								<label class="control-label col-sm-8">附件6：《入场交易协议书》（签字盖章）：</label>
								<div class="col-sm-4">
									<a target="_blank" data-name="strHundredSeven">下载</a>
								</div>
							</div>
					  	</div>
					  	<div class="row" style="margin-left: 20px;">
						  	<div class="form-group col-sm-12">
								<label class="control-label col-sm-8">附件7：《风险提示函》（签字盖章）：</label>
								<div class="col-sm-4">
									<a target="_blank" data-name="strHundredEight">下载</a>
								</div>
							</div>
					  	</div>
				  	</div>
				  	<!-- ORG INFORMATION END!!!! -->
				  	<!-- PERSON INFORMATION START!!!! -->
				  	<div id="_person_view">
				  		<div class="row" style="margin-left: 20px;">
					  		<div class="form-group col-sm-6 ">
								<label class="control-label col-sm-4">性别：</label>
								<div class="col-sm-8">
									<span data-name="userSex"></span>
								</div>
							</div>
							<div class="form-group col-sm-6">
								<label class="control-label col-sm-4">身份证件号码：</label>
								<div class="col-sm-8">
									<span data-name="certNo"></span>
								</div>
							</div>
						</div>
						<div class="row" style="margin-left: 20px;">
							<div class="form-group col-sm-6">
								<label class="control-label col-sm-4">职务：</label>
								<div class="col-sm-8">
									<span data-name="strFiftyTwo"></span>
								</div>
							</div>
						</div>
						<div class="row" style="margin-left: 20px;">
							<div class="form-group col-sm-12">
								<label class="control-label col-sm-8">附件1：交易参与人（自然人）资格申请表：</label>
								<div class="col-sm-4">
									<a target="_blank" data-name="strHundredFour">下载</a>
								</div>
							</div>
						</div>
						<div class="row" style="margin-left: 20px;">
							<div class="form-group col-sm-12">
								<label class="control-label col-sm-8">附件2：交易参与人（自然人）风险评估问卷：</label>
								<div class="col-sm-4">
									<a target="_blank" data-name="strHundredFive">下载</a>
								</div>
							</div>
						</div>
						<div class="row" style="margin-left: 20px;">
							<div class="form-group col-sm-12">
								<label class="control-label col-sm-8">附件3：身份证复印件正面照：</label>
								<div class="col-sm-4">
									<a target="_blank" data-name="strHundredTwo">查看</a>
								</div>
							</div>
						</div>
						<div class="row" style="margin-left: 20px;">
							<div class="form-group col-sm-12">
								<label class="control-label col-sm-8">附件4：身份证复印件反面照：</label>
								<div class="col-sm-4">
									<a target="_blank" data-name="strHundredThree">查看</a>
								</div>
							</div>
						</div>
					  	<div class="row" style="margin-left: 20px;">
							<div class="form-group col-sm-12">
								<label class="control-label col-sm-8">附件5：近期个人金融资产证明材料扫描件:</label>
								<div class="col-sm-4">
									<a target="_blank" data-name="strHundredSix">查看</a>
								</div>
							</div>
						</div>
				  	</div>
	         	</form>
         </div>
      </div>
		<!-- /.modal-content -->
	</div>		
</div> 
  
  
  
	<div class="modal fade" id="act_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog" style="width:900px;">
					<div class="modal-content" id="user-acts"></div>
					</div>
					<!-- /.modal-content -->
	</div>		
</div>    
      <%@include file="/common/sale/foot.jsp" %>
  <!-- 0：待审核  90：审核不通过 91：审核通过 -->
</body>
	<script type="text/template" id="dataList">
	  		<? for ( var i = 0; i < rows.length; i++) {?>
				<tr>
					<!--<td><input type="checkbox" name="" value="" />添加个勾选框，选中后可操作修改/删除</td>-->
					<td style="display:none;"><?=rows[i].userId?></td>
					<td><?=(pageObj.currentPage-1)*10+(i+1) ?></td>
 					<td><?=strUtil.doNull(rows[i].userEname,'')?></td>
 					<td><?=strUtil.subStr(rows[i].userCname,7)?></td>
					<td><?=getOrgCname(rows[i].orgEname)?></td>
					<td><?=rows[i].deptName?></td>
					<!--
					<td><?=DictUtil.getDictNameByFile("userType",0,rows[i].userType)?></td>
						<td><?=DictUtil.getDictNameByFile("userType",0,rows[i].customerType)?></td>
					-->
					<?if(rows[i].userSex=='F'){?>
						<td>女</td>
					<?}else if(rows[i].userSex=='M'){?>
						<td>男</td>
					<?} else{?>
						<td>--</td>
					<?}?>
					<td><?=strUtil.doNull(rows[i].mobile,'')?></td>
					<td><?=getFormatDateByLong(rows[i].createTime)?></td>
					<td>
						<?if(rows[i].userStatus=='1'){?>
						启用
						<?}?>
						<?if(rows[i].userStatus=='0'){?>
						<font color='red'>停用</font>
						<?}?>
						<?if(rows[i].userStatus=='-1'){?>
						<font color='#666'>已作废</font>
						<?}?>
					</td>
					<!--
					<td>
						<?if(rows[i].userStatus=='1'||rows[i].userStatus=='0'){?>
							<button type="button" class="btn btn-success btn-xs" onclick="toEdit('<?=rows[i].userId?>');"> 查看</button> 
							<button type="button" class="btn btn-info btn-xs" onclick="toEdit('<?=rows[i].userId?>');"><i class="fa fa-cog"></i> 修改</button> 
						<?}?>
						<?if(rows[i].userStatus=='1'){?>
							&nbsp;<button type="button" class="btn btn-success btn-xs" onclick="toCancelUser('<?=rows[i].userEname?>');"><i class="fa fa-cog"></i> 销户</button>
						<?}?>
					</td>-->
				</tr>
     		<?}?>
	</script>

<script>
var myAttaServer = '<portal:config varKey="atta_server"/>';
var myAttaDomain = '<portal:config varKey="atta_domain"/>';
var clickMenu= 'transuser-user-list';
var tokenFormIds="editForm1";
var orgEnames = new Array();
var orgCnames = new Array();
$(function () {
	initOrg("searchForm_org");
	getTableData();
	  $("#user-editManager").load("${ctx}/template/uct/member-edit.html",function(){//loadItems(code,cname);
	setToken(tokenFormIds)
	$('#example tbody').on('click','tr', function (e) {
	     if ( $(this).hasClass('selected') ) {
	            //$(this).removeClass('selected');
	        } else {
	            $('tr.selected').removeClass('selected');
	            $(this).addClass('selected');
	        }
	     id = $('tr.selected td').eq(0).html();
	     userId = $('tr.selected td').eq(0).html();
	     userEname = $('tr.selected td').eq(2).html();
	} );
	$("#userForm_orgId").val('${loginUser.orgId}');
	$("#userForm_deptId").val('${loginUser.orgId}');
	DictUtil.getDictExtList("#userType", dictUrl, {cateEname:"userType"});//用户类型
	DictUtil.getRadioList("#userSexDiv","userSex", dictUrl,{cateEname:"userSex"});//用户性别
  });
});
//设置模态框隐藏事件钩子  
$( '#my_modal_edit' ).on( 'hide.bs.modal' ,function(e){ 
	window.location.reload();
	//cleanData('userFormData');
}); 

//设置模态框隐藏事件钩子  
$( '#my_modal' ).on( 'show.bs.modal' ,function(e){  
	$.ajax({ 
		type:'get',
		async:false,
		url:'${ctx}/sendPage/token?token=true',
	    dataType:'json', 
	    success: function(myData){
			 $('#formToken').val(myData);
	  	}
	});	

	//initOrg("orgId");
}); 

function cleanData(id){
<%--	$(':input','#'+id)  --%>
<%--	 .not(':button, :submit, :reset, :hidden')  --%>
<%--	 .val('')  --%>
<%--	 .removeAttr('selected'); --%>
$('#'+id).find(".clean").val("");//按照样式清空；
}

function getTableData(){
	deleteAllRow('example');
	$("#userEname").val($("#userEname").val().trim());
	$("#userCname").val($("#userCname").val().trim());
	$("#act-userId").val(id);
	$.ajax({
		   type:'get',
		   url:common_list_url,//user_search_url,
		   data:$('#searchFrom').serialize()+getCurrentPage(common_list_url+"?"+$('#searchFrom').serialize(),10),
		   dataType:'json',
		   success: function(myData){
			var data = baidu.template('dataList',eval(myData));  
			$("#myList").html(data);
			  var option= {
					   ele:$("#pageList")[0],
					   total:myData.total,
					   fn:getTableData,
					   url:common_list_url+"?"+$('#searchFrom').serialize()
				   }
			generatePages(option);
		   }
		});	
  }
  
function getRoleListData(){
	deleteAllRow('roleList');
	$("#act-userId").val(id);
	$.ajax({ type:'post', url:'${ctx}/res/uct/admin/userRoleData?userId='+id,
		   data:$('#actFrom').serialize(), dataType:'json',
		   success: function(myData){
			var data = baidu.template('roleListData',eval(myData));  
			$("#roleList").html(data);
		   }
	 });	
  } 

function deleteAllRow(tableId){
	var tb = document.getElementById(tableId);
	if(tb){
	     var rowNum=tb.rows.length;
	     for (i=1;i<rowNum;i++){
	         tb.deleteRow(i);
	         rowNum=rowNum-1;
	         i=i-1;
	     }
     }
}
function toAdd(){
	$("#if-sysFlag").show();
	$("#if_update_pass_div").hide();
	$("#edit_user_pass").show();
	
	$('#my_modal').modal('show');
}

function getObjInfo(myData){
	 FormUtil.loadView("", myData);
	 $('#my_modal_edit').modal('show');
}
function toAct(){
	$('#table1 tbody').on('click','tr', function (e) {
	     if ( $(this).hasClass('selected') ) {
	        } else {
	            $('tr.selected').removeClass('selected');
	            $(this).addClass('selected');
	        }
	} );
	//getRoleListData();
	$("#user-acts").load("${ctx}/template/uct/user-acts.html",function(){getRoleListData();});
	$('#act_modal').modal('show');
}

function cannel(modalId){
	$('#'+modalId).modal('hide');
}

function initOrg(selectId){
	$("#"+selectId).html("");
	if("orgId"==selectId)
		$("#"+selectId).append("<option value=''>--请选择--</option>");
	$.ajax({url: org_url+'?orgIds=${loginUser.dataOrgIds }${loginUser.orgId }',  async:false,
        type: "get",dataType: "text",
        success: function(data){
        	if(data){
	        	var obj = $.parseJSON(data);
	        	var selected="";
				for(var i = 0; i < obj.length; i++){
					if(obj[i].orgId=="${loginUser.orgId }" && "orgId"!=selectId)selected="selected=selected"
					$("#"+selectId).append("<option value='"+obj[i].orgId+"' "+selected+">"+obj[i].orgCname+"</option>");
					orgEnames.push(obj[i].orgEname);
					orgCnames.push(obj[i].orgCname);
				}
        	}
        }
    });
}

//value:orgId
function initDept(selectId,value){
	//alert(selectId+"|"+value);
	$("#userForm_deptId").val(value);
	/*if(!value)return;
	$("#"+selectId).html("");
	$("#"+selectId).append("<option value=''>--请选择--</option>");
	$.ajax({ url: dept_url, data:{'orgId':value,'deptId':value},
        async:false,type: "get", dataType: "text",
        success: function(data){
        	var obj = $.parseJSON(data);
			for(var i = 0; i < obj.length; i++){
				$("#"+selectId).append("<option value='"+obj[i].deptId+"'>"+obj[i].deptCname+"</option>");
			}
        }
    });*/
}

function refresh(){
	getTableData();
}


function setDeptIdValue(id,o){
	$("#"+id).val($(o).val());
	$("#searchForm_orgId").val($(o).val());
	
}
//销户
function toCancelUser(){
	if(strUtil.isNull(userId)){
		layer.alert('请先选中一条数据！', {skin: 'layui-layer-molv',closeBtn: 0 });
		return;
	}
	var index_submit = layer.confirm("您确认删除 用户["+userEname+"]吗？", {btn: ['确认','取消'],closeBtn: 0,offset: '220px'}
	, function(){
		layer.close(index_submit);
		var formToken = $("#formToken").val();
		var paramData = {"pageName":"user-list.jsp","formName":"cancelUserForm",
				"uctUser.w_userEname":userEname,"uctUser.userStatus":"0"};
		$.ajax({ type:'post', url:common_submit_url,
		    data:paramData, dataType:'json',
		    success: function(myData){
		    	var flag = "";
		    	var msg = "";
		    	if(myData.msg.indexOf("[")>=0){
			    	var msgData = JSON.parse(myData.msg);
			    	flag = msgData[0].flag;
			    	msg = msgData[0].msg;
		    	}else{
		    		flag=myData.flag;
		    		msg=myData.msg;
		    	}
		    	if(flag=='T'){
		    		$.ajax({
		    			url:del_url,
		    			type:'post',
		    		    data:{"userId":userId,"formToken":formToken},
		    		    dataType:'json',
		    		    success: function(data){
		    		    	console.log(data)
		    		    	if(data.flag=='T'){
		    		    		layer.alert('操作成功！', { skin: 'layui-layer-molv',closeBtn: 0 });
		    		    		refresh();
		    		    	}
		    		  	}
		    		});
		    	}else{
		    		layer.alert(msg, { skin: 'layui-layer-molv',closeBtn: 0 });
		    	}
		  	}
		});	
	})
}
function getOrgCname(orgEname){
	var orgCname = "";
	console.log(orgEnames.indexOf(orgEname));
	orgCname=orgCnames[orgEnames.indexOf(orgEname)];
	return orgCname;
}


function toView(userId){
	//userId=userId;
	//cleanData("auditFrom");
	//$("#auditFrom").find("a").attr("href","");
	if(strUtil.isNull(userId)){
		layer.alert('请先选中一条数据！', {skin: 'layui-layer-molv',closeBtn: 0 });
		return;
	}
	$("#my_modal_view").modal("show");
	$("#auditOptinion").nextAll("span").remove();//清除上次校验记录
	$.ajax({
		url:common_info_url,
		dataType:'json',
		data:{'doCode':'dymicSql','modelTypes':'s_uctUser','uctUser.w_userId':userId},
		type:'get',
		success:function(myData){
			FormUtil.loadView("", myData);
			var customerType = myData.customerType;
			if("person"==customerType){
				$("#_person_view").show();
				$("#_org_view").hide();
			}
			if("org"==customerType){
				$("#_person_view").hide();
				$("#_org_view").show();
			}
			if(myData.userSex=="M"){
				$("span[data-name='userSex']").text("");
				$("span[data-name='userSex']").text("男");
			}else{
				$("span[data-name='userSex']").text("");
				$("span[data-name='userSex']").text("女");
			}
		}
	});
	$.ajax({
		url:common_info_url,
		dataType:'json',
		data:{'doCode':'dymicSql','modelTypes':'s_member','member.w_memberId':userId},
		type:'get',
		success:function(myData){
			FormUtil.loadView("", myData);
			var userEname = myData.userEname;
			$("#sendCode").val(userEname);
		}
	});
}
</script>

</html>
